package cn.itcast.weatherapp123;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.content.Intent;
import android.os.Bundle;
import android.view.WindowManager;

import java.util.List;

import cn.itcast.weatherapp123.adapter.TipsAdapter;
import cn.itcast.weatherapp123.bend.DayWeatherBend;
import cn.itcast.weatherapp123.bend.OtherTipsBean;

public class TipsActivity extends AppCompatActivity {

    private RecyclerView rlvTips;
    private TipsAdapter tipsAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //去除标题导航栏
        getSupportActionBar().hide();
        //去除时间和电量等
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tips);

        rlvTips=(RecyclerView)findViewById(R.id.rlv_tips);

        Intent intent=getIntent();
        DayWeatherBend dayWeatherBend= (DayWeatherBend) intent.getSerializableExtra("tips");
        List<OtherTipsBean> otherTipsBean= (List<OtherTipsBean>) dayWeatherBend.getmTipsBeans();
        tipsAdapter=new TipsAdapter(this,otherTipsBean);
        rlvTips.setAdapter(tipsAdapter);

        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this,RecyclerView.VERTICAL,false);
        rlvTips.setLayoutManager(linearLayoutManager);
    }
}
